<script setup lang='ts'>

const props = defineProps<{
    modelValue:number
}>()

const emits = defineEmits<{
    "update:modelValue":[value:number]
}>()

const sub = (value:number)=>{
    // props.money = props.money - value
    emits('update:modelValue',props.modelValue-value)
}

</script>

<template>
    <div>子组件---{{ modelValue }}</div>
    <button @click="sub(10)">花钱</button>
</template>

<style scoped>
</style>
